#It for some reason does not detect when I touch timeStop
56 messages · Page 1 of 1 (latest)
** You are now Level 3! **
Any errors?
Do a print in every function to see which one is not running
Gotchu
I'll get back with the results
local player = game.Players.LocalPlayer
local button = script.Parent.Button
local timerLabel = script.Parent.TimerLabel
local spawnLocationPart = workspace:WaitForChild("SpawnLocation")
local timeStopPart = workspace:WaitForChild("timeStop")
local timer = 0
local counting = false
local function updateTimerLabel()
local minutes = math.floor(timer / 60)
local seconds = math.floor(timer) % 60
local milliseconds = math.floor((timer - math.floor(timer)) * 1000)
print("UpdateTimerLabel Functions working")
timerLabel.Text = string.format("%02d:%02d:%03d", minutes, seconds, milliseconds)
end
local function startTimer()
counting = true
timerLabel.Visible = true
print("StartTimer Functions working")
while counting do
timer = timer + (1/60)
updateTimerLabel()
wait(1/60)
end
end
local function stopTimer()
counting = false
print("StopTimer Functions working")
end
local function onButtonClicked()
player.Character:SetPrimaryPartCFrame(spawnLocationPart.CFrame)
timer = 0
startTimer()
print("OnButtonClick Functions working")
end
button.MouseButton1Click:Connect(onButtonClicked)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("HumanoidRootPart").Touched:Connect(function(part)
print("Line 47")
if part == timeStopPart then
stopTimer()
print("Line 48")
end
end)
end)
Is this what you meant?
So does the timer works? Like you see the time going up?>
Line 47 and line 48 never gets printed, there is your problem
local char = plr.Character or plr.CharactedAdded:Wait()
part.Touched:Connect(function(hit)
if hit.Parent == char then
stopTimer()
end
end)
Try this
Ummm... Replace it with
player.CharacterAdded:Connect(function(character)
character:WaitForChild("HumanoidRootPart").Touched:Connect(function(part)
print("Line 47")
if part == timeStopPart then
stopTimer()
print("Line 48")
end
end)
end)
Did you used any print()?
Do a print to char
Right before you made the variable char do a print(char)
I might also be a bit slow on the west side
local char = plr.Character or plr.CharactedAdded:Wait()
-->>>>>>
print(char)
-->>>>>>
part.Touched:Connect(function(hit)
if hit.Parent == char then
stopTimer()
end
end)
not to be him but can you do it for me since I'm still a bit slow on the north side
omg... Just print(char)
Not my proudest moment
I literally can't say anything more... Is that simple..
so just print(char) anywhere?
Preferably under the variable char
** You are now Level 4! **
....... ?
You got the wrong code
Um... nope!
The code under this I replaced the code with the same code
I didn't realize
Also replacing it directly with that wont work
Not my produest moment
Proudest
So all fixed?
yeah sure
Good