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

Touched function in a localscript wont work?

Asked by 8 years ago
local Stage1 = script.Parent
local Reset = Instance.new("BoolValue")
Reset.Parent = Stage1
Reset.Name = "StageReset"
Reset.Value = false
local Start = Stage1.StartPart
local Finish = Stage1.FinishPart

Finish.Touched:connect(function()
    print"Finished"
    if Reset.Value == false then
        Reset.Value = true
        Stage1.Target1.ColorPart1.BrickColor = "Really red"
        Stage1.Target1.ColorPart2.BrickColor = "Really red"
        Stage1.Door1.Transparency = 0.8
        Stage1.Door1.Script.Disabled = false
        Stage1.Door1.CanCollide = true
    end
end)

1 answer

Log in to vote
0
Answered by
LostPast 253 Moderation Voter
8 years ago

This should be in a regular script if it is on the server side.(in the workspace.) localscripts are only used on the client side(in the player or in the character.)

The touched event is already serverside so you do not need remote events or anything. just change the script to a regular old script.

Ad

Answer this question