I'm new to scripting, but i've tried hours on this and nothing will work.. so far in studio the changing camera part works and changing song part works, but only in studio, not in game. so nothing of this works, but i get no errors! can anyone please tell me problems with the script, i need help
debounce = false
function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and debounce == false then
debounce = true
player:WaitForChild("PlayerGui").Credits.Frame.Visible = true
debounce = false
end
end
local Camera = game.workspace.CurrentCamera
script.Parent.Touched:Connect(function (hit)
Camera.CameraType = "Scriptable"
Camera.CFrame = game.workspace.CamPart2.CFrame
end)
local debounce = false
Music = script.credits
STAR = game.SoundService.STAR
script.Parent.Touched:connect(function(hit)
if not hit.Parent:FindFirstChild("Humanoid") then return end
debounce = true
Music:Play()
STAR:Pause()
end)
local debounce = false
script.Parent.Touched:Connect(function (hit)
debounce = true
game.Workspace.mainwallz.CanCollide = true
end)

1 comment
Because the CurrentCamera is client sided.