Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script Ignores Event in game but not in studio wtf?

Alrighty. So title is pretty much everything you need to know about the problem

Ok, so i have this local script detecting mouse click on a button to fire the event to the main script which scales the character

click = game.Workspace.Button.ClickDetector

smolEvent = game:GetService("ReplicatedStorage").Smol

  

click.MouseClick:Connect(function()

smolEvent:FireServer()

print("Event sent")

end)

this is the main script

local tweenService = game:GetService("TweenService")

local door = game.Workspace.Door

local tweenInfo = TweenInfo.new(3,Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)

local goal = {}

goal.Position = Vector3.new(45.555, 4.938, -47.221)

  

tween = tweenService:Create(door,tweenInfo,goal)

  

local goal2 = {}

goal2.Position = Vector3.new(door.Position.X, door.Position.Y-10, door.Position.Z)

  

tween2 = tweenService:Create(door,tweenInfo,goal2)

  

debounce = true

  

local smol = game:GetService("ReplicatedStorage").Smol

  

smol.OnServerEvent:Connect(function(plr)

local character = plr.Character or plr.CharacterAdded:wait()

print("event recieved")

script.Parent.Touched:Connect(function(hit)

if hit.Parent:FindFirstChild("Humanoid") then

if debounce == true then

debounce = false

tween:Play()

local headscale = hit.Parent:FindFirstChild("Humanoid"):WaitForChild("HeadScale")

local rigHeight = hit.Parent:FindFirstChild("Humanoid"):WaitForChild("BodyHeightScale")

local rigWidth = hit.Parent:FindFirstChild("Humanoid"):WaitForChild("BodyWidthScale")

local rigDepth = hit.Parent:FindFirstChild("Humanoid"):WaitForChild("BodyDepthScale")

wait(3)

game.Workspace.TubeParticle.ParticleEmitter.Enabled = true

wait(1)

for i = rigHeight.Value,0.3,-0.01 do

rigHeight.Value = i

rigWidth.Value = i

rigDepth.Value = i

headscale.Value = i

wait(0.01)

end

game.Workspace.TubeParticle.ParticleEmitter.Enabled = false

wait(1)

tween2:Play()

debounce = true

end

end

wait(5)

end)

end)

so when the button is clicked it fires the event which this script picks up in the roblox studio, but when i go onto roblox game it just completely ignores it and goes to this

script.Parent.Touched:Connect(function(hit)

which just activates the sizing thing without pressing the button, any thoughts?

edit - ive printed some stuff in studio and in game it says studio -

event sent 
event recieved 
event sent
event recieved 
event sent 
event recieved 
event sent 
event recieved 
event sent 
event recieved

in game -

event sent 
event sent 
event sent 
event sent

any help is appreciated.

3 comments

0

Shouldn't MouseButton be MouseButton1Click?

0

Mousebutton1click is for guis I’m using a click detector

0

I discourage you from adding 'wtf' into your title. It may get moderated since some consider it inappropriate...

1 answer

✓ Accepted answer

hi hello yes

try using wait forchild

the fitnessgram pacer test is a multistage aerobic capcity test

1 comment

0

ok this is epic thank you for work ok ty epic man

This discussion is preserved as it was. New answers, comments, and votes are closed.