Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my brick change the stage number?

Asked by 10 years ago

NOTE: I am a beginner in scripting.

I am making a Cave Obby type game. link here: http://www.roblox.com/Cave-Checkpoint-Adventure-place?id=186626805

And, I have a script where it acts like a Spawn Location. When you step on that brick, your stage number changes from 0 to 1. But It doesn't. Why so?

Script:

local sp = script.Parent
local player = game.Players.LocalPlayer

local humanoid = player:FindFirstChild("Humanoid")

function onTouch(sp)
    if (humanoid ~= nil) then 
        if player:onTouch(sp) then
        player.StarterGui.Stage.TextButton.Text="Stage    /    1"
    end
    end
end

script.Parent.Touched:connect(onTouch)

Thanks :)

0
Oh come on. A demote! mikeCONronald 25 — 10y
0
I would just get rid of the whole B1 thing. If you want "sp" to be B1 just set it to whatever you want B1 to be. Get rid of B1. raystriker6707 30 — 10y

1 answer

Log in to vote
0
Answered by
Relatch 550 Moderation Voter
10 years ago
local sp = script.Parent
local plr = game.Players.LocalPlayer
local B1 = --explain what "B1" is

sp = B1
local stage = plr.StarterGui.Stage

B1.Touched:connect(function()
    stage =  "Stage / 1"
end
0
Doesn't work :/ I changed line 03 too. If you are wondering. Thanks for your effort though, mikeCONronald 25 — 10y
Ad

Answer this question