Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does my brick change the stage number?

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 :)

2 comments

0

Oh come on. A demote!

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.

1 answer

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

1 comment

0

Doesn't work :/ I changed line 03 too. If you are wondering. Thanks for your effort though,

This discussion is preserved as it was. New answers, comments, and votes are closed.