Problem is, It won't even activate. Won't Print Activated at all. Yes, its a server script. And Its in Workspace, and FE is on.
AND IT WORKS IN STUDIO. AND ONLY IN STUDIO.
local Char = script.Parent.Char local Water = script.Parent.Liquid local Button = script.Parent.Button local CanClick = true local Left = 10 local Hats = script.Parent.Char:GetChildren() local HeadOriginalCFrame = Char.Head.Frame script.Parent.Button.ClickDetector.MouseClick:connect(function(Player) print("Activated") if CanClick == true then CanClick = false for i=50,2,-.2 do Water.Mesh.Scale = Vector3.new(Water.Mesh.Scale.X,Water.Mesh.Scale.Y-.2,Water.Mesh.Scale.Z) Water.Position = Vector3.new(Water.Position.X,Water.Position.Y -.02,Water.Position.Z) wait() end local Torso = Player.Character:FindFirstChild("Torso") if Torso then local DefaultCFrame = {Char.Head.CFrame:components()} local LookLimit = coroutine.create(function() for i=1,Left do Left = Left -1 wait(1) end Left = 10 end) coroutine.resume(LookLimit) repeat Char.Head.CFrame = CFrame.new(Char.Head.Position,Torso.Position) wait() until Left == 0 Char.Head.CFrame = CFrame.new(DefaultCFrame[1],DefaultCFrame[2],DefaultCFrame[3],DefaultCFrame[4],DefaultCFrame[5],DefaultCFrame[6],DefaultCFrame[7],DefaultCFrame[8],DefaultCFrame[9],DefaultCFrame[10],DefaultCFrame[11],DefaultCFrame[12]) end for i=2,50,.2 do Water.Mesh.Scale = Vector3.new(Water.Mesh.Scale.X,Water.Mesh.Scale.Y+.2,Water.Mesh.Scale.Z) Water.Position = Vector3.new(Water.Position.X,Water.Position.Y +.02,Water.Position.Z) wait() end CanClick = true Char.Head.CFrame = HeadOriginalCFrame end end)
Not sure if you meant a GUI button or Part with a ClickDetector
Click Detector If you want to use a ClickDetector then you should make a model put the script inside there and put the the part in there with the ClickDetector. It might have been your directory. You should then insert this into the script. (You must use a regular script for this to work.)
script.Parent.Button.ClickDetector.MouseClick:connect(function(Player) print("Activated") end)
GUI TextButton If you wanted to use a GUI button your event should be.
script.Parent.TextButton.MouseButton1Down:connect(function(Player) print("Activated") end
Text buttons do NOT use .MouseClick For a full list of the events that can be used please refer to the ROBLOX wiki page. http://wiki.roblox.com/index.php?title=TextButton
If you need any more help please contact me