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

Mouse Click Not Activating? [NO SOLUTION?]

Asked by
Vezious 310 Moderation Voter
8 years ago

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)
0
Please please PLEASE tab your code. It makes it easier to read for both you and those attempting to analyze. Legojoker 345 — 8y
0
Why would it print "Activated?" It doesn't say print("Activated") anywhere. 1waffle1 2908 — 8y
0
Sorry I replaced the script and well. Let me update it again. Vezious 310 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

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

0
Its not a text button... And My Directory isn't wrong, it is a server script. Vezious 310 — 8y
0
Ok try using this then: function onClicked() print("Activated") end script.Parent.Button.ClickDetector.MouseClick:connect(onClicked) Warfaresh0t 414 — 8y
0
Nope :( Don't Work. Vezious 310 — 8y
0
Does it help to mention I moved the game from my game to a group game? Vezious 310 — 8y
Ad
Log in to vote
-3
Answered by
Vividex 162
8 years ago

You do realize there is something called a "TextButton" in ROBLOX for a reason right? XD

0
? Ok? And? Vezious 310 — 8y

Answer this question