Scripts in ScreenGui not functioning on server?
Hi there, scripters!
I ran into a problem when trying to make an interface located inside the player's ScreenGui. I am aware that the recent Roblox update forced FE on, but I can't seem to fix this. Any help is appreciated! Both of these scripts are inside of a textbox, inside of a ScreenGui:
Local script- indexes mouse and runs while loop:
02 | mouse = game.Players.LocalPlayer:GetMouse() |
03 | speed = game.ReplicatedStorage.Speed:Clone() |
04 | speed.Parent = game.Players.LocalPlayer |
05 | health = game.ReplicatedStorage.Health:Clone() |
06 | health.Parent = game.Players.LocalPlayer |
09 | for i,v in pairs (script.Parent:GetChildren()) do |
10 | if v.Name = = "SpeedButton" then |
11 | v.Position = UDim 2. new( 0 ,speed.Value, 0 ,v.Position.Y.Offset) |
12 | script.Parent.Script.Adjust:FireServer(v,speed,health,mouse, "WalkSpeed" , "MaxHealth" , 0.17 , 1.05 ) |
14 | if v.Name = = "HealthButton" then |
15 | v.Position = UDim 2. new( 0 ,health.Value, 0 ,v.Position.Y.Offset) |
16 | script.Parent.Script.Adjust:FireServer(v,health,speed,mouse, "MaxHealth" , "WalkSpeed" , 1.05 , 0.17 ) |
18 | if v.Name = = "Done" then |
19 | v.MouseButton 1 Click:Connect( function () |
20 | script.Parent.Visible = false |
21 | script.Parent.Sound 1 :Play() |
Script- receives fire server and mouse coordinates
03 | script.Adjust.OnServerEvent:Connect( function (player,v,value 1 ,value 2 ,mouse,property 1 ,property 2 ,x 1 ,x 2 ) |
04 | v.MouseButton 1 Down:Connect( function () |
08 | if mouse.X > 5 and mouse.X < 190 then |
09 | value 1. Value = math.floor(mouse.X/ 15 )* 15 + 5 |
10 | value 2. Value = 190 - (math.floor(mouse.X/ 15 )* 15 + 5 ) |
12 | mouse.Button 1 Up:Connect( function () |
16 | player.Character.Humanoid [ property 1 ] = value 1. Value * x 1 + 10 |
17 | player.Character.Humanoid [ property 2 ] = value 2. Value * x 2 + 10 |
18 | player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth |
I'd also like to mention that this works fine in Studio, but on a server it's broken. It doesn't show any error messages in the output... Thanks!