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 9 years ago
01local Stage1 = script.Parent
02local Reset = Instance.new("BoolValue")
03Reset.Parent = Stage1
04Reset.Name = "StageReset"
05Reset.Value = false
06local Start = Stage1.StartPart
07local Finish = Stage1.FinishPart
08 
09Finish.Touched:connect(function()
10    print"Finished"
11    if Reset.Value == false then
12        Reset.Value = true
13        Stage1.Target1.ColorPart1.BrickColor = "Really red"
14        Stage1.Target1.ColorPart2.BrickColor = "Really red"
15        Stage1.Door1.Transparency = 0.8
16        Stage1.Door1.Script.Disabled = false
17        Stage1.Door1.CanCollide = true
18    end
19end)

1 answer

Log in to vote
0
Answered by
LostPast 253 Moderation Voter
9 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