So I've been testing couple of scripts they did worked but that one didn't
Here is the main script :
player = game.Players.LocalPlayer
script.MyFunction.OnServerInvoke = function(player)
local part = Instance.new("Part")
part.Parent = workspace
part.Name = "Imprintedone"
part.Anchored = false
part.Color = Color3.new(Random)
part.Position = Vector3.new(-35.94, 52.4, -17.69)
end
Note: The main script has Function object in it
InvokeServer server script :
player = game.Players.LocalPlayer
game.StarterGui:WaitForChild("ScreenGui")
game.StarterGui.ScreenGui.TextButton.MouseButton1Click:Connect(function(player)
game.Workspace.Main.MyFunction:InvokeServer()
end)
game.StarterGui.ScreenGui.TextButton.MouseButton1Click:Connect(player)
It doens't work can anyone tell me why?
note: the InvokeServer server script is in starterpack and a local script as well
