Город МОСКОВСКИЙ
00:13:50

How to make Blox Fruit in Roblox Studio | Part 01

Аватар
Геймерская Революция
Просмотры:
1 059
Дата загрузки:
30.10.2023 06:49
Длительность:
00:13:50
Категория:
Лайфхаки

Описание

"How to make Blox Fruit in Roblox Studio | Part 01"

Model - https://www.roblox.com/library/12426172741/BloxFruitShop-ByVoicelessDev

Scripts
◻️ Server script :-
local replicatedStorage = game.ReplicatedStorage
local RemoteEvents = replicatedStorage:FindFirstChild("RemoteEvents")
local OpenEvent = RemoteEvents:FindFirstChild("OpenEvent")
local CloseEvent = RemoteEvents:FindFirstChild("CloseEvent")

local Player = nil
local Humanoid = nil

local Part = script.Parent

Part.Touched:Connect(function (object)

if object.Parent:FindFirstChild("Humanoid") then

Player = game.Players:FindFirstChild(object.Parent.Name)
Humanoid = object.Parent:FindFirstChild("Humanoid")

OpenEvent:FireClient(Player)
Humanoid.WalkSpeed = 0

end

end)

CloseEvent.OnServerEvent:Connect(function ()

Humanoid.WalkSpeed = 16

end)


◻️ Local script :-
local MainUI = script.Parent:FindFirstChild("FruitShop")
local CloseButton = MainUI:FindFirstChild("TextButton")
local SlotTemp = MainUI:FindFirstChild("SlotTemp"):FindFirstChild("Slot")

local replicatedStorage = game.ReplicatedStorage
local RemoteEvents = replicatedStorage:FindFirstChild("RemoteEvents")
local OpenEvent = RemoteEvents:FindFirstChild("OpenEvent")
local CloseEvent = RemoteEvents:FindFirstChild("CloseEvent")

local Fruits = replicatedStorage:FindFirstChild("Fruits"):GetChildren()

OpenEvent.OnClientEvent:Connect(function ()

MainUI.Visible = true

end)

CloseButton.MouseButton1Click:Connect(function ()

CloseEvent:FireServer()
MainUI.Visible = false

end)

function CheackItems()

for i,v in pairs(Fruits) do

local SlotClone = SlotTemp:Clone()
SlotClone.Name = "Slot"..i
SlotClone.Parent = MainUI:FindFirstChild("Shop")

SlotClone:FindFirstChild("Price").Text = v:FindFirstChild("Price").Value
SlotClone:FindFirstChild("FruitName").Text = v.Name
SlotClone:FindFirstChild("FruitDP").Text = v:FindFirstChild("Dis").Value

end

end

CheackItems()

◻️ Buy Button script :-
local Button = script.Parent
local Slot = Button.Parent
local InfoBar = Slot.Parent.Parent:FindFirstChild("InfoBar")

Button.MouseButton1Click:Connect(function ()

InfoBar.Visible = true
InfoBar.FruitName.Text = Slot.FruitName.Text
InfoBar.Price.Text = Slot.Price.Text

end)


Sorry, I'm not gonna give the Whole Project...

Music by @TheFatRat @neffexmusic

Рекомендуемые видео