#Fireing event on touched wont work

1 messages · Page 1 of 1 (latest)

stuck flicker
#
-- ServerScriptService/StartGameTrigger
local startPart = workspace:WaitForChild("StartPart")

startPart.Touched:Connect(function(hit)
    print("Tocuhed 1")
    local character = hit.Parent
    local player = game.Players:GetPlayerFromCharacter(character)
    if player then
        print("Touched 2")
        local startGameEvent = game.ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("StartGame")
        startGameEvent:FireClient(player)
    end
end)
startGameEvent.OnClientEvent:Connect(function()
    if gameStarted then print("no") return end
    gameStarted = true
    revealSafeZone()
    print("Game started from server!")

    local centerTile = gridFolder:FindFirstChild("Tile_" .. centerX .. "_" .. centerY)
    local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
    if centerTile and hrp then
        hrp.CFrame = centerTile.CFrame + Vector3.new(0, 6, 0)
    end
end)```
#

So i get the touched prints

#

but no other prints from the other code

#

which is a local script

#

inside of startplayerscripts

dapper garnet
#

if that ^ then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
end

stuck flicker
#

it is on the server in the serverscriptservice

stuck flicker
#

which code