RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"disable my ability to move forward or backward and add it to the script you just generated"
-- script for sell pad local part = script.Parent local function collect(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player then local playerBag = player.leaderstats.Bag.Value if playerBag > 0 then player.leaderstats.Bag.Value = 0 player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + (playerBag * 25) end end end part.Touched:Connect(collect) -- script for part local part = script.Parent local addPoint = true local function collect(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player and addPoint then local playerBag = player.leaderstats.Bag.Value if playerBag < 3 then addPoint = false player.leaderstats.Bag.Value = player.leaderstats.Bag.Value + 1 part.Position = Vector3.new(math.random(-100,100),part.Position.Y, math.random(-100,100)) wait(1) addPoint = true end end end part.Touched:Connect(collect) -- local script to disable forward and backward movement local player = game:GetService("Players").LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local function disableForwardBackward() if humanoid.MoveDirection.Z ~= 0 then humanoid.MoveDirection = Vector3.new(humanoid.MoveDirection.X, humanoid.MoveDirection.Y, 0) end end humanoid.Running:Connect(disableForwardBackward)